﻿using System;
using System.Collections.Generic;
using System.Text;
using YouHP.Utility;
using YouHP.BLL;
using YouHP.Model;

namespace YouHP.Pages
{
    public class DiseaseSelector : BasePage
    {
        protected List<DiseaseInfo> DszList { get; set; }
        protected int PageCount { get; set; }
        protected string PageNumbers { get; set; }
        protected int PageIndex { get; set; }
        protected const int PageSize = 15;

        private int _diseaseCount = 0;
        protected int DszCount { get { return _diseaseCount; } }

        protected override void ShowPage()
        {
            base.ShowPage();

            string url = "DiseaseSelector.aspx";
            PageIndex = RequestTools.GetQueryInt("page", 1);
            DszList = DiseaseBLL.Instance.GetDiseaseList(PageSize, PageIndex, out _diseaseCount);
            PageCount = Utils.GetPageCount(DszCount, PageSize);
            PageNumbers = Utils.GetPageNumbers(PageIndex, PageCount, url, 8, "page", null);
        }
    }
}
